package com.jack.leetcode.每日一题;

/*** 
 * @author zhangjie
 * @date 2020/5/9 19:43
 */
public class x的平方根 {

    public static void main(String[] args) {
        int x = 2147395600;
        System.out.println(mySqrt(x));
    }

    public static int mySqrt(int x) {
        int i = 0;
        while (i * i <= x && i <= 46340) {
            i++;
        }
        return i - 1;
    }
}
